package com.firexxx.vp.domain.vp.single;

import java.util.HashMap;

/**
 * @description: TODO
 * @author: zhuangzhang2
 * @date: 2020-12-30 11:19
 */
public enum Gender {
    Female(0),
    Male(1),
    UnKnown(2);

    private int intValue;
    private static HashMap<Integer, Gender> mappings;

    private static synchronized HashMap<Integer, Gender> getMappings() {
        if (mappings == null) {
            mappings = new HashMap();
        }

        return mappings;
    }

    private Gender(int value) {
        this.intValue = value;
        getMappings().put(value, this);
    }

    public int getValue() {
        return this.intValue;
    }

    public static Gender forValue(int value) {
        return (Gender)getMappings().get(value);
    }
}
